package com.shenglaotuan.community.common.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResponseResult<T> {
    private Integer code;
    private String message;
    private T Data;
    public static final Integer SUCCESS_CODE = 200;
    public static final String SUCCESS_MESSAGE = "OK";

    public static ResponseResult<Void> responseSuccess(){
        return new ResponseResult<Void>(SUCCESS_CODE, SUCCESS_MESSAGE, null);
    }

    public static <T> ResponseResult<T> responseSuccess(T data){
        return new ResponseResult<T>(SUCCESS_CODE, SUCCESS_MESSAGE, data);
    }
}
